package com.refusea.train.controller

import com.refusea.train.domain.entity.LessonScheduleConfig
import com.refusea.train.domain.helper.LessonScheduleConfigHelper
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestBody
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

/**
 * @author Zhang Yan 2024/4/10
 **/
@RestController
@RequestMapping("/api/private/ls_config")
class LessonScheduleConfigController(private val lessonScheduleConfigHelper: LessonScheduleConfigHelper) {

    @GetMapping("/get")
    fun get(): LessonScheduleConfig {
        return lessonScheduleConfigHelper.select();
    }

    @PostMapping("/save")
    fun save(@RequestBody lessonScheduleConfig: LessonScheduleConfig): Int {
        return lessonScheduleConfigHelper.save(lessonScheduleConfig)
    }
}
